package com.ctsi.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctsi.common.util.Search;
import com.ctsi.core.common.util.StringUtil;
import com.ctsi.core.database.util.PageUtil;
import com.ctsi.system.entity.SmsSysSign;
import com.ctsi.system.mapper.SmsSignMapper;
import com.ctsi.system.service.ISmsSignService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * smssign 服务实现类
 * </p>
 *
 * @author fxd
 * @date 2022-03-17 09:29:06
 */
@Service
public class SmsSignServiceImpl extends ServiceImpl<SmsSignMapper, SmsSysSign> implements ISmsSignService {

	@Override
	public IPage<SmsSysSign> listPage(Search search) {
		LambdaQueryWrapper<SmsSysSign> queryWrapper = Wrappers.lambdaQuery();
		if (StringUtil.isNotBlank(search.getKeyword())) {
			queryWrapper.like(SmsSysSign::getId, search.getKeyword());
		}
		queryWrapper.orderByDesc(SmsSysSign::getCreateTime);
		return this.baseMapper.selectPage(PageUtil.getPage(search), queryWrapper);
	}
}
